project(curl)

file(GLOB_RECURSE CSOURCES lib/*.c)
file(GLOB_RECURSE HHEADERS include/*.h lib/*.h)

include_directories(. include lib ../mbedtls/include)

add_library(
  curl
  SHARED
  ${HHEADERS} ${CSOURCES}
  )
add_definitions(-DBUILDING_LIBCURL -DUSE_MBEDTLS)
target_link_libraries(curl mbedtls)

if(WIN32)
  target_link_libraries(curl ws2_32)
  if(NOT MSVC)
    target_link_libraries(curl ws2_32 wldap32)
  endif()
else()
  add_definitions(-DHAVE_CONFIG_H)
endif()
